package com.zws.cucumber.util;

import java.util.function.Consumer;

public class ZwsTestObjBuilder<T> {

    public static <T> ZwsTestObjBuilder<T> testObjBuilder(T obj) {
        return new ZwsTestObjBuilder<>(obj);
    }

    private final T pojo;

    public ZwsTestObjBuilder(T pojo) {
        this.pojo = pojo;
    }
    public ZwsTestObjBuilder<T> with(Consumer<T> consumer) {
        consumer.accept(pojo);
        return this;
    }

    public T build() {
        return pojo;
    }

}
